package com.example.springaopstudy.service;

import com.example.springaopstudy.model.Articleinfo;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ArticleService {

    public List<Articleinfo> query() {
        int a = 1/0;
        //模拟数据库查询比较耗时的情况
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        //模拟在数据库查询文章
        return new ArrayList<>();
    }
}
